package stream.sort;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author cyt
 * @create 2020-09-08 14:40
 */
public class Sort {

    public static void main(String[] args) {
        ArrayList<Object> list = new ArrayList<>();
        list.add("ff");
        list.add("dd");
        list.add("cc");

        List<Object> collect = list.stream()
                .sorted(Comparator.comparing(Object::toString))
                .collect(Collectors.toList());
        for (Object o : collect) {
            System.out.println(o);
        }
    }
}
